import { Injectable } from '@nestjs/common'
import { CreateLogDto } from './dto/create-log.dto'
import { UpdateLogDto } from './dto/update-log.dto'
import { PrismaService } from 'src/prisma/prisma.service'

@Injectable()
export class LogService {
  constructor(private prisma: PrismaService) {}
  create(createLogDto: CreateLogDto) {
    return this.prisma.log.create({ data: createLogDto })
  }

  findAll() {
    return this.prisma.log.findMany()
  }

  findOne(id: number) {
    return this.prisma.log.findFirst({ where: { id } })
  }

  update(id: number, updateLogDto: UpdateLogDto) {
    return this.prisma.log.update({ where: { id }, data: updateLogDto })
  }

  remove(id: number) {
    return this.prisma.log.delete({ where: { id } })
  }
}
